
import Vue from "vue"


import VueRouter from "vue-router"
// 导入页面组件
// import App from "@/App.vue";
import Discover from "@/view/discover/Discover.vue"
import Recommend from "@/view/discover/Recommend.vue"
import TopList from "@/view/discover/TopList.vue"
import PlayList from "@/view/discover/PlayList.vue"
import DJRadio from "@/view/discover/DJRadio.vue"
import ArtList from "@/view/discover/ArtList.vue"
import AlBum from "@/view/discover/AlBum.vue"

import DownLoad from "@/view/download/DownLoad.vue"
import Friend from "@/view/friend/Friend.vue"
import My from "@/view/my/My.vue"






// <!--.写一下这配置数组【{}】每个对象都代表，访问的路径是什么，访问的这个路径-->
Vue.use(VueRouter)

    // 书写配置数组
    const routes = [
            {
                path:'/',
                redirect:'/recommend',
            },
        {
            path:'/discover',
            component:Discover,
            redirect:'/recommend',
            children:[
                {
                    path:'/recommend',
                    component:Recommend
                },
                {
                    path: '/toplist',
                    component: TopList
                },{
                    path: '/playlist',
                    component: PlayList
                },
                {
                    path: '/djradio',
                    component: DJRadio
                },
                {
                    path: '/artlist',
                    component: ArtList
                },
                {
                    path: '/album',
                    component:AlBum
                }
            ]
        },
        {
            path: '/download',
            component: DownLoad
        },
        {
            path:'/friend',
            component: Friend
        },
        {
            path: '/my',
            component:My
        }
        ]


        const router = new VueRouter({
            routes:routes
            })
// <!--.将创建出来的路由对象，导出配置好的路由-->
    export default router;
